package config

import "github.com/spf13/viper"

type Config struct {
	Mysql struct {
		User     string
		Password string
		Host     string
		Port     int
		Database string
	}
}

type Nacos struct {
	NamespaceId string
	IpAddr      string
	Port        int
	DataId      string
	Group       string
}

var AppConfig Nacos

func Init() {
	viper.SetConfigFile("D:\\student\\gowork\\src\\five\\zk\\good\\good-server\\basic\\config\\dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic("读取失败")
	}
	err = viper.Unmarshal(&AppConfig)
	if err != nil {
		panic("解析失败")
	}

}
